// 我要拿的数据
var data = {
    imgUrl: "url('https://openfile.meizu.com/group1/M00/07/C4/Cgbj0F6zwMuANEeWAAw6yQFAJXM097.png@240x240.jpg')",
    title: "【新品】魅族 17",
    price: "￥3699"
}

/*
    imgUrl:     i.header-product-img的background-image
    title:      i.header-product-img.nextSibling的data
    price:      li下的em内容innerText
*/


// 拿一条数据
var o1 = {}
var li = $0.querySelector("li");
o1.imgUrl = li.querySelector("i.header-product-img").style.backgroundImage;
o1.title = li.querySelector('i.header-product-img').nextSibling.data;
o1.price = li.querySelector('em').innerText;


// 批量拿数据
var arr = [];
var lis = $0.querySelectorAll("li");
for (var i = 0; i < lis.length; i++) {
    var o1 = {}
    var li = lis[i];
    o1.imgUrl = li.querySelector("i.header-product-img").style.backgroundImage;
    o1.title = li.querySelector('i.header-product-img').nextSibling.data;
    o1.price = li.querySelector('em').innerText;
    // console.log(o1);
    arr.push(o1);
}
// console.log(arr);
var jsonStr = JSON.stringify(arr);
console.log(jsonStr);